<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>JWEB极速开发框架</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="shortcut icon" href="/assets/images/favicon.svg">
    <link rel="stylesheet" href="/assets/layuiadmin/start/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/assets/layuiadmin/start/layui/lay/modules/xIcon/font-awesome/css/font-awesome.css" media="all">
    <link rel="stylesheet" href="/assets/layuiadmin/main.css" media="all">
    <link rel="stylesheet" href="/assets/layuiadmin/start/layui/css/modules/selects/formSelects-v4.css" media="all">
    <link rel="stylesheet" href="/assets/layuiadmin/start/layui/css/modules/selects/formSelects-v4.modify.css" media="all">
    <script>
        /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');
    </script>
    <link rel="stylesheet" href="/assets/highlight/styles/default.css">
    <script src="/assets/highlight/highlight.pack.js"></script>
    <script src="/assets/highlight/highlightjs-line-numbers.min.js"></script>
    <style>
        /* for block of numbers */
        .hljs-ln-numbers {
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;

            text-align: center;
            color: #ccc;
            border-right: 1px solid #CCC;
            vertical-align: top;
            padding-right: 5px;

            /* your custom style here */
        }

        /* for block of code */
        .hljs-ln-code {
            padding-left: 10px;
        }
    </style>
</head>
<body>
<div id="LAY_app"></div>
<script src="/assets/layuiadmin/start/layui/layui.js"></script>
<script src="/assets/jweb/jweb.js"></script>
<script>
    layui.config({
        base: '/assets/layuiadmin/dist/' //指定 layuiadmin 项目路径，本地开发用 src，线上用 dist
        , version: '1.4.0-#(ts)'
    }).extend({ //设定模块别名
        xUtils: '{/}/assets/layuiadmin/start/layui/lay/modules/xUtils',
        xSelects: '{/}/assets/layuiadmin/start/layui/lay/modules/xSelects',
        xmSelect: '{/}/assets/layuiadmin/start/layui/lay/modules/xmSelect/xm-select',
        formSelects: '{/}/assets/layuiadmin/start/layui/lay/modules/formSelects-v4',
        treeTable: '{/}/assets/layuiadmin/start/layui/lay/modules/treeTable',
        xEditor: '{/}/assets/layuiadmin/start/layui/lay/modules/xEditor/xEditor',
        xFile: '{/}/assets/layuiadmin/start/layui/lay/modules/xFile/xFile',
        number: '{/}/assets/layuiadmin/start/layui/lay/modules/numinput/numinput',
        xIcon: '{/}/assets/layuiadmin/start/layui/lay/modules/xIcon/xIcon',
        xAce: '{/}/assets/layuiadmin/start/layui/lay/modules/xAce/xAce',
        xTree: '{/}/assets/layuiadmin/start/layui/lay/modules/xTree/xTree',
        xce: '{/}/assets/layuiadmin/start/layui/lay/modules/xce/xce',
        xStep: '{/}/assets/layuiadmin/start/layui/lay/modules/xStep/xStep',
    }).use('index');

    // 全局配置ajax请求异常提示
    layui.use(["jquery", "layer"], function () {
        let $ = layui.$, layer = layui.layer;
        $.ajaxSetup({
            error: function (xhr) {
                if (xhr.status < 400) {
                    return;
                }
                console.log('请求错误：', xhr);
                if (xhr.status == 403 || xhr.status == 450) {
                    var result;
                    try {
                        var result = eval('(' + xhr.responseText + ')');
                    } catch (e) {
                    }
                    layer.msg("登录会话已过期, 正在跳转登录页...");
                    setTimeout(function () {
                        if (result && result.location) {
                            window.location.href = result.location;
                        } else {
                            window.location.href = '/console';
                        }
                    }, 3000);
                    return;
                } else {
                    layer.msg("请求错误：" + xhr.status + " " + xhr.statusText);
                }
            }
        })
    })
    layui.use("xmSelect", function(){
        // 预先加载xm-select组件，因为某些场合，会导致xm-select加载执行报xm-select未定义问题
    })
</script>
</body>
</html>


